<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"><HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<META NAME="GENERATOR" CONTENT="Adobe FrameMaker 7.0/HTML Export Filter">
<LINK REL="STYLESHEET" HREF="KDM_1.0_p2_programel.css" CHARSET="ISO-8859-1" TYPE="text/css">
<TITLE> 	Part 2. Program Elements Layer</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<DIV>
<H6 CLASS="Heading">
<A NAME="pgfId-1096814"></A>Part 2. Program Elements Layer</H6>
<P CLASS="Body">
<A NAME="pgfId-1096816"></A>The Program Elements Layer defines a large set of meta-model elements whose purpose is to provide a language-independent intermediate representation for various  constructs determined by common programming languages. </P>
<P CLASS="Body">
<A NAME="pgfId-1096965"></A>Program Layer defines a single KDM Model, called CodeModel, and consists of the following KDM packages:</P>
<UL>
<LI CLASS="Bullet1">
<A NAME="pgfId-1096966"></A>Code</LI>
<LI CLASS="Bullet1">
<A NAME="pgfId-1096981"></A>Action</LI>
</UL>
<P CLASS="Body">
<A NAME="pgfId-1096974"></A>Code package defines CodeItems (named elements determined by the programming language, the so-called &quot;symbols,&quot; &quot;definitions,&quot; etc.)  and structural relations between them. CodeItems are further categorized into ComputationalObject, Datatypes and Modules. Action package defines behavioral elements and various behavioral relationships, which detemine the control- and data- flows between code items. </P>
<P CLASS="Body">
<A NAME="pgfId-1097035"></A>Description of the Code package is further subdivided into the following parts:</P>
<UL>
<LI CLASS="Bullet1">
<A NAME="pgfId-1097036"></A>Code Elements representing Modules</LI>
<LI CLASS="Bullet1">
<A NAME="pgfId-1097037"></A>Code Elements representing Computational Objects</LI>
<LI CLASS="Bullet1">
<A NAME="pgfId-1097038"></A>Code Elements representing Datatypes</LI>
<LI CLASS="Bullet1">
<A NAME="pgfId-1097039"></A>Code Elements representing Preprocessor Directives</LI>
<LI CLASS="Bullet1">
<A NAME="pgfId-1097033"></A>Miscellaneous Code Elements</LI>
</UL>
<P CLASS="Body">
<A NAME="pgfId-1097014"></A>Data representation of KDM is aligned with ISO/IEC 11404 (Language-Independent datatypes) standard. In particular, KDM provides distinct meta-model elements for &quot;data elements&quot; (for example, global and local variables, constants, record fields, parameters, class members, array items and pointer base elements) and &quot;datatypes&quot;. Each data element has an association &quot;type&quot; to its datatype. KDM distinguishes primitive datatypes (for example Integer, Boolean), complex user-defined datatypes (for example, array, pointer, sequence) and named datatypes (for example, a class, a synonym type). KDM meta-model elements corresponding to datatypes are subclasses of a generic class Datatype. KDM meta-model elements corresponding to data elements are subclasses of a generic class DataElement.</P>
<P CLASS="Body">
<A NAME="pgfId-1097015"></A>KDM model elements represent existing artifacts determined by a programming language. KDM meta-model elements provide sufficient coverage for most common datatypes and data elements, common to programming languages. KDM also provides several powerful generic extensible elements that can be further used with stereotypes to represent uncommon situations.</P>
<P CLASS="Body">
<A NAME="pgfId-1097012"></A>In addition to the type association, KDM relationship &quot;HasType&quot; is used to track named datatypes. Anonymous datatypes can be owned by the data element that uses it. </P>
<P CLASS="Body">
<A NAME="pgfId-1096994"></A>The meta-model elements of the Program Elements Layer uses the following naming conventions (whenever practical):</P>
<UL>
<LI CLASS="Bullet1">
<A NAME="pgfId-1096995"></A>suffix &quot;Element&quot;  - usually designates a generic meta-model element</LI>
<LI CLASS="Bullet1">
<A NAME="pgfId-1096996"></A>suffix &quot;Type&quot; - designates a meta-model element representing some datatype</LI>
<LI CLASS="Bullet1">
<A NAME="pgfId-1097006"></A>suffic &quot;Unit&quot; - designates a concrete meta-model element</LI>
</UL>
</DIV>
</BODY>
</HTML>
